package com.cy.cdas.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.deser.std.DateDeserializers;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//@Data注解应用于类上，自动生成getter、setter、toString、equals、hashCode和构造方法，无需手动编写这些方法‌
@Data
public class User {
    private int id;
    private String headImg;
    private String name;
    private String gender;
//    @DateTimeFormat(pattern = "yyyy-MM-dd") //约束前端发来的格式
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) //约束前端发来的格式,springboot自带的
    @JsonFormat(pattern = "yyyy-MM-dd") //约束后端相应的格式  来自spring-boot-starter-web依赖的jasckson，无需再次导入jackson依赖
    private Date birthday;


    private String account;
    private String password;
    private String email;
    private String phone;
    private String isAdmin;
}
